using HKB.Data.Dal.S_AdTableAdapters;
using System;
using System.Data;
namespace HKB.Web
{
	public class AdBll
	{
		public int _ADID;
		public int _UserID;
		public string _ZoneID;
		public int _AdType;
		public string _ADName;
		public string _ImgUrl;
		public int _ImgWidth;
		public int _ImgHeigth;
		public bool _FlashWmode;
		public string _AdIntro;
		public string _LinkUrl;
		public string _LinkTarget;
		public string _LinkAlt;
		public string _Priority;
		public int _CountView;
		public string _Setting;
		public int _Views;
		public int _Clicks;
		public bool _CountClick;
		public bool _Passed;
		public DateTime _EndTime;
		private static readonly HL_Advertisement1TableAdapter Adapter = new HL_Advertisement1TableAdapter();
		public AdBll()
		{
		}
		public AdBll(int ADID, string ZoneID, int AdType, string ADName, string ImgUrl, int ImgWidth, int ImgHeigth, bool FlashWmode, string AdIntro, string LinkUrl, string LinkTarget, string LinkAlt, string Priority, int CountView, string Setting, int Views, int Clicks, bool CountClick, bool Passed, DateTime EndTime)
		{
			this._ADID = ADID;
			this._ZoneID = ZoneID;
			this._AdType = AdType;
			this._ADName = ADName;
			this._ImgUrl = ImgUrl;
			this._ImgWidth = ImgWidth;
			this._ImgHeigth = ImgHeigth;
			this._FlashWmode = FlashWmode;
			this._AdIntro = AdIntro;
			this._LinkUrl = LinkUrl;
			this._LinkTarget = LinkTarget;
			this._LinkAlt = LinkAlt;
			this._Priority = Priority;
			this._CountView = CountView;
			this._Setting = Setting;
			this._Views = Views;
			this._Clicks = Clicks;
			this._CountClick = CountClick;
			this._Passed = Passed;
			this._EndTime = EndTime;
		}
		public DataTable GetAllAd()
		{
			return AdBll.Adapter.GetAllAD();
		}
		public DataTable GetSingeleAd(int ADID)
		{
			return AdBll.Adapter.GetSingleAD(ADID);
		}
		public bool UpdateAd(string ZoneID, int AdType, string ADName, string ImgUrl, int ImgWidth, int ImgHeigth, int FlashWmode, string AdIntro, string LinkUrl, int LinkTarget, string LinkAlt, int Priority, bool CountView, string Setting, int Views, int Clicks, bool CountClick, bool Passed, DateTime EndTime, int ADID)
		{
			int num = AdBll.Adapter.UpdateAD(ZoneID, new int?(AdType), ADName, ImgUrl, new int?(ImgWidth), new int?(ImgHeigth), new int?(FlashWmode), AdIntro, LinkUrl, new int?(LinkTarget), LinkAlt, new int?(Priority), new bool?(CountView), Setting, new int?(Views), new int?(Clicks), new bool?(CountClick), new bool?(Passed), new DateTime?(EndTime), ADID);
			return num > 0;
		}
		public int InsertAD(int UserID, string ZoneID, int AdType, string ADName, string ImgUrl, int ImgWidth, int ImgHeigth, int FlashWmode, string AdIntro, string LinkUrl, int LinkTarget, string LinkAlt, int Priority, string Setting, int Views, bool CountView, bool CountClick, int Clicks, bool Passed, DateTime EndTime)
		{
			return int.Parse(AdBll.Adapter.GetReturnID(new int?(UserID), ZoneID, new int?(AdType), ADName, ImgUrl, new int?(ImgWidth), new int?(ImgHeigth), new int?(FlashWmode), AdIntro, LinkUrl, new int?(LinkTarget), LinkAlt, new int?(Priority), Setting, new bool?(CountView), new int?(Views), new bool?(CountClick), new int?(Clicks), new bool?(Passed), new DateTime?(EndTime)).Rows[0]["ADID"].ToString());
		}
		public bool DeleteAd(int ADID)
		{
			int num = AdBll.Adapter.DeleteAD(ADID);
			return num > 0;
		}
		public void PassedAd(bool boolPassed, string adiidarr)
		{
			AdBll.Adapter.PassedAd(new bool?(boolPassed), adiidarr);
		}
		public DataTable UpdateADCount(int ADID)
		{
			return AdBll.Adapter.UpdateADCount(new int?(ADID));
		}
		public void UpdateAdViews(int ADID)
		{
			AdBll.Adapter.UpdateAdViews(ADID);
		}
		public bool FindFileByFileName(string FileName)
		{
			return AdBll.Adapter.FindFileByFileName(FileName).Rows.Count <= 0;
		}
		public void DeleteAds(string ArrayAdID)
		{
			AdBll.Adapter.DeleteAds(ArrayAdID);
		}
		public DataTable GetAdByNameIntro(string AdName, string AdIntro)
		{
			return AdBll.Adapter.GetAdByNameIntro(AdName, AdIntro);
		}
	}
}
